<script setup>import { useRoute, useRouter } from 'vue-router';
import Loading from '../components/Loading.vue';
import Card from '../components/Card.vue';
import { getRecruitListByPid } from '../api/project';
import useLoadData from '../hooks/useLoadData';
import { watchEffect } from 'vue';
//初始化
const route = useRoute()
const router = useRouter()
const { isError, isLoading, data } = useLoadData(
    getRecruitListByPid(route.params.pid)
)

watchEffect(v => {
    console.log(data.value);
})



</script>

<template>
    <Loading class="manage-container" :is-error="isError" :is-loading="isLoading">
        <van-cell-group>
            <van-cell
                v-for="item, inde in data"
                :title="item.title"
                is-link
                :to="'/recruit/update/' + item.rid"
            />
        </van-cell-group>
        <van-button round color="var(--main-color)" :to="'/recruit/create/' + route.params.pid">添加</van-button>
    </Loading>
</template>

<style scoped>
.manage-container {
    position: relative;
}
.van-button {
    position: absolute;
    bottom: var(--page-padding);
    left: var(--page-padding);
    right: var(--page-padding);
    width: calc(100% - var(--page-padding) * 2);
}
</style>